package cn.lzx.lock.domain;

import lombok.Data;

import javax.persistence.*;

/**
 * Created by lizhenxing on 2018/1/9.
 */
@Entity
@Table(
        uniqueConstraints = @UniqueConstraint(name = "idx_unq_identity", columnNames = "identity"),
        indexes = @Index(name = "idx_username", columnList = "username")
)
@Data
public class User {

    @Id
    private Long id;
    private String username;
    private String password;

    @Enumerated(EnumType.STRING)
    private Sex sex;
    private Integer age;
    private String homeTown;
    private String identity;

    public enum Sex {
        MAN, WOMAN
    }
}
